﻿using System;
using System.Collections.Generic;
using System.Xml;
using System.Xml.XPath;

namespace Allegro.TaskExecution
{
    /// <summary>
    /// XML Persistence interface
    /// </summary>
    public interface IXmlPersist
    {
        /// <summary>
        /// Save to XML
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="persistenceContext"></param>
        void Save(XmlWriter writer, IXmlPersistenceContext persistenceContext);

        /// <summary>
        /// Load from XML
        /// </summary>
        /// <param name="navigator"></param>
        /// <param name="persistenceContext"></param>
        void Load(XPathNavigator navigator, IXmlPersistenceContext persistenceContext);
    }

    /// <summary>
    /// XML Persistence context
    /// </summary>
    public interface IXmlPersistenceContext
    {
        /// <summary>
        /// Xml namespace manager used for loading XML
        /// </summary>
        XmlNamespaceManager NamespaceManager { get; set; }
    }
}
